/**
 * 公共基础接口封装
 */
import request from '@/utils/request'

export const getLoginInfo = () => {
  return request({
    method: 'GET',
    url: '/code'
  })
}

// 获取验证码
export const getCaptcha = () => {
  return request<Blob>({
    method: 'GET',
    url: '/captcha_pro',
    responseType: 'blob' // 请求获取图片数据
  })
}

// 登录
export const login = (data: {
  email: string,
  password: string,
  code: string
}) => {
  return request({
    method: 'POST',
    url: '/login',
    data
  })
}

// 退出登录
export const logout = () => {
  return request({
    method: 'POST',
    url: '/logout'
  })
}
